#define STARTGAME

using UnityEngine;
using System.Collections;

public class PlayerMovement : MonoBehaviour 
{
	float speed = 25.0f;
	bool tapped = false;
	
	void Start () 
	{
	
	}

	void Update () 
	{
		if(tapped)
		{
			
		}

		Vector3 dir = Vector3.zero;

		dir.x = Input.acceleration.x;
		dir.z = 0;
		
		if (dir.sqrMagnitude > 1)
		{
			dir.Normalize();
		}
		
		dir *= Time.deltaTime;
			
		transform.Translate (dir * speed);
	}
	
	void OnTriggerEnter(Collider other)
	{
		if(other.gameObject.tag == "Wall")
		{
            other.gameObject.GetComponent<WallColision>().SendToOtherPosition();
		}
	}
}